﻿
Public Class frmMain
    Public strUN As String = ""
    Public strMK As String = ""

    Private Sub ThoátToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Close()
    End Sub

    Private Sub ĐăngNhậpToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ĐăngNhậpToolStripMenuItem.Click
        Dim frm = frmDangNhap
        frm.Show()
    End Sub

    Private Sub NhânViênToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NhânViênToolStripMenuItem.Click
        Dim frm = frmNhanVien
        frm.Show()
        frm.MdiParent = Me
    End Sub

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.WindowState = FormWindowState.Maximized
        lbTrangThaiDangNhap.Text = "Bạn cần đăng nhập để sử dụng phần mềm"

        MenuStrip1.Items(1).Enabled = False
        MenuStrip1.Items(2).Enabled = False
        MenuStrip1.Items(3).Enabled = False
        MenuStrip1.Items(4).Enabled = False
        HệThốngToolStripMenuItem.DropDownItems.Item(1).Enabled = False
        HệThốngToolStripMenuItem.DropDownItems.Item(2).Enabled = False

    End Sub

    Private Sub ThoátToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ThoátToolStripMenuItem.Click
        Close()
    End Sub

    Private Sub MặtHàngToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MặtHàngToolStripMenuItem.Click

    End Sub

    Private Sub ĐăngXuấtToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ĐăngXuấtToolStripMenuItem.Click

        MsgBox("Bạn có muốn thoát?", MsgBoxStyle.OkCancel, "Thông báo")

        lbTrangThaiDangNhap.Text = "Bạn cần đăng nhập để sử dụng phần mềm"
        MenuStrip1.Items(1).Enabled = False
        MenuStrip1.Items(2).Enabled = False
        MenuStrip1.Items(3).Enabled = False
        MenuStrip1.Items(4).Enabled = False
        HệThốngToolStripMenuItem.DropDownItems.Item(0).Enabled = True
        HệThốngToolStripMenuItem.DropDownItems.Item(1).Enabled = False
    End Sub

    Private Sub ĐổiMậtKhẩuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ĐổiMậtKhẩuToolStripMenuItem.Click
        Dim frm = frmDoiMatKhau
        frm.Show()
        frm.MdiParent = Me
    End Sub

    Private Sub PhiếuNhậpKhoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhiếuNhậpKhoToolStripMenuItem.Click
        Dim frm = frmQuanLyPhieuNhap
        frm.Show()
        frm.MdiParent = Me
    End Sub

    Private Sub PhiếuXuấtKhoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhiếuXuấtKhoToolStripMenuItem.Click
        Dim frm = frmQuanLyPhieuXuat
        frm.Show()
        frm.MdiParent = Me
    End Sub

    Private Sub QuầyThuNgânToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QuầyThuNgânToolStripMenuItem.Click
        Dim frm = frmQuanLyThuNgan
        frm.Show()
        frm.MdiParent = Me
    End Sub

    Private Sub MặtHàngToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MặtHàngToolStripMenuItem1.Click
        Dim frm = frmTKMatHang
        frm.Show()
        frm.MdiParent = Me
    End Sub

    Private Sub NhânViênToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NhânViênToolStripMenuItem1.Click
        Dim frm = frmTKNhanVien
        frm.Show()
        frm.MdiParent = Me
    End Sub

    Private Sub DanhSáchNhânViênToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DanhSáchNhânViênToolStripMenuItem.Click
        frmDanhSachNhanVien.Show()
    End Sub

    Private Sub TồnKhoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TồnKhoToolStripMenuItem.Click
        frmTonKho.Show()
    End Sub

    Private Sub ĐơnVịToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ĐơnVịToolStripMenuItem.Click
        frmQuanLyDonVi.Show()
    End Sub

    Private Sub TàiKhoảnToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TàiKhoảnToolStripMenuItem.Click
        frmQuanLyTaiKhoan.Show()
    End Sub
End Class